package org.example.controller;
import org.example.domain.ResponseResult;
import org.example.service.UploadService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class UploadController {

    private final UploadService uploadService;

    public UploadController(UploadService uploadService) {
        this.uploadService = uploadService;
    }

    @PostMapping("/upload")
    public ResponseResult uploadImg(@RequestParam("file") MultipartFile file){

        return uploadService.uploadImg(file);
    }


}
